{extend name="base"/}
{block name="resources"}
<link rel="stylesheet" href="SHOP_CSS/goods_lists.css">
{/block}
{block name="main"}
<style>
	td{
		text-align: center;
	}
	.goods-category-container{
		z-index: 999!important;
	}
</style>
<!-- 筛选面板 -->
<div class="ns-screen layui-collapse" lay-filter="selection_panel">
	<div class="layui-colla-item">
		<h2 class="layui-colla-title"></h2>
		<form class="layui-colla-content layui-form layui-show">
			<div class="layui-form-item">
				<div class="layui-inline">
					<label class="layui-form-label">供应商名称：</label>
					<div class="layui-input-inline">
						<input type="text" name="offer_name" placeholder="请输入供应商名称" autocomplete="off" class="layui-input">
					</div>
				</div>

				<div class="layui-inline">
					<label class="layui-form-label">商品SKU：</label>
					<div class="layui-input-inline">
						<input type="text" name="sku_id" placeholder="请输入商品SKU" autocomplete="off" class="layui-input">
					</div>
				</div>

				<div class="layui-inline">
					<label class="layui-form-label">商品名称：</label>
					<div class="layui-input-inline">
						<input type="text" name="search_text" placeholder="请输入商品名称" autocomplete="off" class="layui-input">
					</div>
				</div>

				<div class="layui-inline">
					<label class="layui-form-label">商品分类：</label>
					<div class="layui-input-inline">
						{include file="goods/category_select" /}
					</div>
				</div>
			</div>
			<div class="layui-form-item">
				<div class="layui-inline">
					<label class="layui-form-label">库存状态：</label>
					<div class="layui-input-inline">
						<select name="stock_status" lay-verify="stock_status">
							<option value="">全部</option>
							<option value="1">库存不足</option>
							<option value="2">库存正常</option>
						</select>
					</div>
				</div>
				<div class="layui-inline">
					<label class="layui-form-label">最近报价时间：</label>
					<div class="layui-input-inline">
						<input type="text" class="layui-input" name="start_time" placeholder="开始时间" id="start_time" readonly>
						<i class="ns-calendar"></i>
					</div>
					<div class="layui-form-mid">-</div>
					<div class="layui-input-inline">
						<input type="text" class="layui-input" name="end_time" placeholder="结束时间" id="end_time" readonly>
						<i class="ns-calendar"></i>
					</div>
					<button class="layui-btn layui-btn-primary date-picker-btn" onclick="datePick(7, this);return false;">近7天</button>
					<button class="layui-btn layui-btn-primary date-picker-btn" onclick="datePick(30, this);return false;">近30天</button>
				</div>

				<input type="hidden" name="goods_state" />
				<div class="layui-inline">
					<button class="layui-btn ns-bg-color" lay-submit lay-filter="search">筛选</button>
					<button type="reset" class="layui-btn layui-btn-primary">重置</button>
				</div>
			</div>
		</form>
	</div>
</div>

<table id="goods_list" lay-filter="goods_list"></table>

<!-- 商品信息 -->
<script type="text/html" id="goods_info">
	<div class="ns-table-title">
		<div class="ns-title-pic" id="sku_img_{{d.sku_id}}_{{d.offer_member}}">
			<img layer-src src="{{ns.img(d.sku_image, 'small')}}"/>
		</div>
		<div class="ns-title-content">
			<a href="javascript:;" class="ns-multi-line-hiding ns-text-color" title="{{d.sku_name}}" lay-event="preview">{{d.sku_name}}</a>
			{{# if(d.promotion_addon){ }}
			<div class="promotion-addon">
				{{# for(var i=0;i<d.promotion_addon_list.length;i++){ }}
				<a href="{{ns.url( d.promotion_addon_list[i].url )}}"><span class="ns-bg-color" title="{{d.promotion_addon_list[i].name}}">{{ d.promotion_addon_list[i].short }}</span></a>
				{{# } }}
			</div>
			{{# } }}
		</div>
	</div>
</script>

<!-- 操作 -->
<script type="text/html" id="operation">
	<div class="operation-wrap">
		<div class="popup-qrcode-wrap"><img class="popup-qrcode-loadimg" src="__STATIC__/loading/loading.gif" /></div>
		<div class="ns-table-btn">
			<a class="layui-btn" lay-event="offer_stock">代设库存</a>
			<a class="layui-btn" lay-event="delete_offer">删除报价</a>
		</div>
	</div>
</script>

<!--报价-->
<script type="text/html" id="offer_price_stock">
	<div class="layui-form">
		<div class="layui-form-item">
			<label class="layui-form-label" style="width: unset;">我的报价：</label>
			<div class="layui-input-block" style="margin-left: 80px">
				<input type="number" name="price" class="layui-input" autocomplete="off" placeholder="请输入您的报价">
			</div>
		</div>
	</div>
	<div class="layui-form">
		<div class="layui-form-item">
			<label class="layui-form-label" style="width: unset;">我的库存：</label>
			<div class="layui-input-block" style="margin-left: 80px">
				<input type="number" name="stock" class="layui-input" autocomplete="off" placeholder="请输入您的库存">
			</div>
		</div>
	</div>
	<div class="footer-wrap" style="position: absolute;bottom: 12px;right: 15px;">
		<button class="layui-btn ns-bg-color" lay-filter="submit">确定</button>
		<button class="layui-btn layui-btn-primary" onclick="layer.closeAll()">取消</button>
	</div>
</script>
{/block}

{block name="script"}
<script src="SHOP_JS/all_offer_goods.js?v={:time()}"></script>
{/block}